package com.qf.service.impl;

import com.qf.dao.AddressDao;
import com.qf.pojo.Address;
import com.qf.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author bss
 * @version V1.0
 * @Project maven
 * @Package com.qf.service.impl
 * @Description:
 * @Date 2022/10/3 20:31
 */
@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    AddressDao addressDao;
    @Override
    public List<Address> findById(int id) {
        List<Address> addById = addressDao.findAddById(id);
        return addById;
    }

    @Override
    public void addAddress(Address address) {
        addressDao.addAddress(address);
    }

    @Override
    public void deleteById(int id) {
        addressDao.deleteAddById(id);
    }

    @Override
    public void updateAddress(Address address) {
        addressDao.updateAddress(address);
    }

    @Override
    public void setdefaultAddress(int uid, int id) {
        addressDao.setNoAll(uid);
        addressDao.setOne(id);
    }

    @Override
    public Address findByOrderAId(int aid) {
        return null;
    }
}
